// https://leetcode.cn/problems/valid-word/description/
import 
(
	"unicode"
)

func isValid(word string) bool {
    rec := [36]int{}
	c := 0
	t := 0
	d := 0
	for _, v := range word {
		if unicode.IsLetter(rune(v)) {
			v = unicode.ToLower(rune(v))
			if rec[v - 'a'] == 0 {
				c++
			}
			rec[v - 'a']++
		} else if unicode.IsDigit(rune(v)) {
			if rec[26 + v - '0'] == 0 {
				c++				
			}
			rec[26 + v - '0']++
			d++
		} else {
			return false
		}	
		t++
	}
	a := rec[0] + rec['e' - 'a'] + rec['i' - 'a'] + rec['o' - 'a'] + rec['u' - 'a']
	b := t - d - a
	return  a > 0 && b > 0 && len(word) >= 3
}
